import { Component, OnInit, Inject, forwardRef, ViewChild } from '@angular/core';
import { AppComponent } from '../../../app.component';
import { path } from '../../../path.config';
import { masterService } from '../../../../lib/master.service';
import { ExchangeCardQueryGridComponent } from './exchange-card-query-grid/exchange-card-query-grid.component';

@Component({
    selector: 'exchange-card-query',
    templateUrl: './exchange-card-query.component.html',
    styleUrls: ['./exchange-card-query.component.css']
})
export class ExchangeCardQueryComponent implements OnInit {
    @ViewChild('ExchangeCardQueryGrid') ExchangeCardQueryGrid: ExchangeCardQueryGridComponent;

    public filter = {
        code: ''
    }

    constructor(private _masterService: masterService,
        @Inject(forwardRef(() => AppComponent)) public app: AppComponent) { }

    ngOnInit() { }

    // 过滤grid数据
    selectListItem() {
        if (!this.filter.code) {
            this.app.toastWarning('请输入卡号查询！');
            return;
        }
        this.ExchangeCardQueryGrid.onChangeTable(this.filter);
    }
}
